package tower;

import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;

import bullet.*;
import other.*;
<<<<<<< HEAD
/**
 * 
 * @author gjj
 *
 */
public class FanTower extends AbstractTowers{
=======
import tower.*;
//风扇头炮塔 
public class FanTower extends Towers{
>>>>>>> c395a618f3269afd99f5d475d02e9af0223e39ba
	
	protected static BufferedImage[] TowerImages=new BufferedImage[3];
	static {
		try{
			for(int i=0;i<TowerImages.length;i++) {
					TowerImages[i]=ImageIO.read(GreenTower.class.getResource("/png/Fan"+i+"0.png"));
			}
		}catch(Exception e){
			e.printStackTrace();
			throw new RuntimeException();
		}
	}
	
	public FanTower(int x, int y) {
		super(x, y, 350,1,160,TowerImages);
	}
	
	int index=1;
	@Override
	public AbstractBullets getNewBullet() {
		if(shootState) {
			final int temp=12;
			if(index++%temp==0) {
				return (new BulletOfFan(this.x, this.y, this.towerAngle, this.level,this.range,this.attack));
			}
		}
		return null;
	}
	@Override
	public void setLevel(int level) {
		World.score-=price;
		this.level = level;
		this.attack =level+2;
	}
}
